# -*- coding: utf-8 -*-
# Project : flacon
# File : flac_encoder.py
# (c) Alexander Sokolov sokoloff.a@gmail.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

import encoderConfigPage
import flaconglobal

from encoderConfigPage import EncoderConfigPage
from flac_config_ui import Ui_flacConfigPage as UI


class FlacConfig(EncoderConfigPage, UI):

   #****************************************************************
   #
   #****************************************************************
    @staticmethod
    def defaults():
        return {
            'Flac/Compression':     5,
            'Flac/ReplayGain':      flaconglobal.ReplayGainTypes.Disable,
        }


   #****************************************************************
   #
   #****************************************************************
    def __init__(self, parent):
        EncoderConfigPage.__init__(self, parent)
        self.setupUi(self)

        self.setLosslessToolTip(self.flacCompressionSlider)
        self.flacCompressionSpin.setToolTip(self.flacCompressionSlider.toolTip())
        self.fillReplayGainComboBox(self.flacGainCbx)


        self.loadSlider('Flac/Compression',  self.flacCompressionSlider)
        self.loadComboBox('Flac/ReplayGain', self.flacGainCbx)


   #****************************************************************
   #
   #****************************************************************
    def write(self):
        self.writeSlider('Flac/Compression',  self.flacCompressionSlider)
        self.writeComboBox('Flac/ReplayGain', self.flacGainCbx)

